function test_4C()
    data=D300F3();    
    [corrplanes,sups,clusters]=a4C(data,300,6,2,0.1,0.25);
    for i=1:length(clusters)
        points=clusters{i};
        plot3(points(:,1),points(:,2),points(:,3),'black+');
        hold on;
    end
    %filtercorrelations(corrplanes,originalplanes);
    corratts={};
    for i=1:length(corrplanes)
        corratts{i}=[1,2,3];
    end
    displaycorrelations(corrplanes,sups,corratts,0.01, 'test_4C.txt');
end

function data=D300F3()
    numpoints = 100;
    r=200;
    x1=randint(1,numpoints,[-r,r]);
    y1=randint(1,numpoints,[-r,r]);
    z1=2*x1+y1+randn(1,numpoints); % 2x1+x2-x3=0
    x2=randint(1,numpoints,[-r,r]);
    y2=randint(1,numpoints,[-r,r]);
    z2=x2*3-y2*5+randn(1,numpoints); % 3x1-5x2-x3=0
    x3=randint(1,numpoints,[-r,r]);
    y3=randint(1,numpoints,[-r,r]);
    z3=-4*x3-2*y3+100+randn(1,numpoints); % 4x1+2x2+x3=100
    x=[x1,x2,x3];
    y=[y1,y2,y3];
    z=[z1,z2,z3];
    data=[ x',y',z'];
    plot3(x,y,z,'r.');
    hold on;
    [x,y] = meshgrid(-r:2*r:r);
    z=3*x-5*y;
    surf(x,y,z,'FaceColor','cyan','FaceAlpha',0.2);
    hold on;
    z=2*x+y;
    surf(x,y,z,'FaceColor','yellow','FaceAlpha',0.2);
    hold on;
    z=-4*x-2*y+100;
    surf(x,y,z,'FaceColor','green','FaceAlpha',0.2);
    hold on;
    grid on;
end
